package com.hdax.dm.feign.fallback;

import com.hdax.dm.beans.base.image;
import com.hdax.dm.feign.imagefeign;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ImageFallbackFactory implements FallbackFactory<imagefeign> {

    @Override
    public imagefeign create(Throwable cause) {
        return new imagefeign() {
            @Override
            public image image(Long targetId, Long type, Long category) {
                image image = new image();
                image.setImgUrl("https://s1.ax1x.com/2022/08/23/vcYwLD.png");
                System.out.println("****************");
                System.out.println("获取图片失败");
                System.out.println("****************");
                return image;
            }
        };
    }
}
